﻿using AmiDraw.Lib;
using Panuon.UI.Core;
using PropertyChanged;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using AmiDraw.Lib.Models;

namespace AmiDraw.Editor.Model
{
    [AddINotifyPropertyChangedInterface]
    public class ObservableLevel:AcLevel
    {
        public ObservableCollection<ObservableCard> Cards { get; set; }

        [JsonIgnore]
        public ICommand DeleteCardCommand { get; set; }

        public ObservableLevel()
        {
            DeleteCardCommand = new RelayCommand(RemoveCard);
        }

        public void AddCard()
        {
            Cards.Add(new ObservableCard());
        }

        public void RemoveCard(object obj)
        {
            Cards.Remove(obj as ObservableCard);
            MessageBox.Show("删除成功");
        }
    }
}
